from rest_framework.views import APIView
from rest_framework.response import Response
from .models import Area
from .serializer import AreaSerializer

class AreaList(APIView):
  def get(self, request):
    qs = Area.objects.filter(parent=None)
    serializer = AreaSerializer(qs, many=True)

    return Response(serializer.data)
